﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using TestBat.IModels.Domain;
using TestBat.IViewModels.Workspaces.Results;

namespace TestBat.Views.TemplateSelectors
{
    public class TestTaskTemplateSelector : DataTemplateSelector
    {

        public DataTemplate TestEssayTaskTemplate { get; set; }
        public DataTemplate TestMultipleChoiceTaskTemplate { get; set; }
        public DataTemplate TestMultipleResponseTaskTemplate { get; set; }

        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            if (item is IResultTestEssayTaskViewModel) return TestEssayTaskTemplate;
            if (item is IResultTestMultipleChoiceTaskViewModel) return TestMultipleChoiceTaskTemplate;
            if (item is IResultTestMultipleResponseTaskViewModel) return TestMultipleResponseTaskTemplate;
            return null;
        }
    }
}
